import React from 'react'
import { connect } from 'react-redux'
import { Button } from 'antd'
import { updateData, login, dotest } from '../../redux/user'
import { Link } from 'react-router-dom'
import HtmlDead from '../../component/html-head'
import { isDev } from '../../util/config'

import './homepage.less'

@connect(
  state=>state.user,
  { updateData, login, dotest }
)
class HomePage extends React.Component{
  constructor(props) {
    super(props)
    this.state ={
      data:''
    }
  }
  componentDidMount() {
    console.log(isDev)
    if (isDev) {
      this.props.dotest()
    }
  }
  render() {
    const { data } = this.props
    return (
      <div>
        <HtmlDead data={data} />
        <Link to={'/login'}><Button>点击登录</Button></Link>
      </div>
    )
  }
}
export default HomePage